package com.bjpowernode.service;

import com.bjpowernode.dao.StudentDao;
import com.bjpowernode.entity.Student;

import java.util.ArrayList;
import java.util.List;

public class StudentServiceImpl implements StudentService {
    //引用类型
    private StudentDao studentDao;

    //使用set注入，赋值
    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public int addStudent(Student student) {
        int num=studentDao.insertStudent(student);

        return num;
    }

    @Override
    public List<Student> queryAllStudents() {
        List<Student> list=new ArrayList<>();
        list= studentDao.selectAllStudents();
        return list;
    }
}
